MessageBox
Result = MessageBox(Title$, Message$, [Buttons], [Icon])
 
Parameters:

    Title$=the title of the message boc
    Message$= the actual message
    [Buttons]= the button combination to be shown
    [Icon]=the icon of the dialog
Returns:

    Result=the button the user pressed
 

     MessageBox opens a standard Windows message box. You can specify an icon and pick from a set of button combinations.

The function returns the button the user has clicked. You can compare the result to the following predefined constant:
MB_Result_OK = 1
MB_Result_Cancel = 2
MB_Result_Abort = 3
MB_Result_Retry = 4
MB_Result_Ignore = 5
MB_Result_Yes = 6
MB_Result_No = 7
MB_Result_TryAgain = 10
MB_Result_Continue = 11

* Icon = specifies the Icon of the dialog. See below for a list of possible icons
* Title$ = the text of the title bar on the top of the dialog
* Text$ = the message text
* Buttons = one of the possible button combinations. You can find the list below. This parameter is optional and default to the "OK" button.

Possbile Icons:
MB_Icon_None = 0
MB_Icon_Warning = 1
MB_Icon_Question = 2
MB_Icon_Error = 3
MB_Icon_Info = 4

Possible button combinations
MB_Button_OK = 0
MB_Button_OKCancel = 1
MB_Button_AbortRetryIgnore = 2
MB_Button_YesNoCancel = 3
MB_Button_YesNo = 4
MB_Button_RetryCancel = 5
MB_Button_CancelTryAgainContinue = 6




FACTS:


      * the dialog is not asynchronous and therefore the PlayBasic application will halt while the dialog is open.


  
; Include the Dialogs library in this program
  #Include "PBDialogs2"
  
; Clear the Screen to Blue
  Cls RGB(0,0,255)
  
; Init the Message Box dialogs TItle and messages
  Title$="Message Box"
  Text$="Important Question: Is Today A Wednesday ?"
  
  
; Call the Message Box Function.  This box will
; have a YES & NO option for the users
  UserAction=MessageBox(Title$,Text$,MB_Button_YesNo)
  
  
; display a message depending upon what the user pressed
  Select UserAction
      Case MB_Result_No
          Print "You Pressed NO"
      Case MB_Result_Yes
          Print "You Pressed Yes"
  EndSelect
  
  
  Sync
  WaitKey
  
  
  
  





 
Related Info: Alert | MessageDlg :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com